import Vue from 'vue'
import VueRouter from 'vue-router'
import AddTeacher from "../views/AddTeacher";
import EditCourse from "../views/EditCourse";
import EditTeacher from "../views/EditTeacher";
import FindAmount from "../views/FindAmount";
import FindMoney from "../views/FindMoney";
import FindStudent from "../views/FindStudent";
import UpdateCourse from "../views/UpdateCourse";
import UpdateTeacher from "../views/UpdateTeacher";
import Index from "../views/Index";
import Login from "../views/Login";

import MyCourse from "../views/MyCourse";
import Student from "../views/Student";
import ChooseWarehouse from "../views/ChooseWarehouse";
import Pay from "../views/Pay";
import FindTeacher from "../views/FindTeacher";
import FindCourse from "../views/FindCourse";
import DeleteTeacher from "../views/DeleteTeacher";
import DeleteCourse from "../views/DeleteCourse";
import ShowCourse from "../views/ShowCourse";

Vue.use(VueRouter)

export const startLogin = [
  {
    path : '/',
    name : '登录',
    component : Login,
  }
]

export const adminLogin = [
  {
    path : '/Add',
    name : '添加',
    component : Index,
    redirect : "/ChooseWarehouse",
    children : [
      {
        path : '/ChooseWarehouse',
        name : '添加仓库信息',
        component : ChooseWarehouse,
      }
    ]
  },
  {
    path: '/delete',
    name : '删除',
    component: Index,
    children: [
      {
        path: '/DeleteCourse',
        name : '删除仓库信息',
        component: DeleteCourse,
      }
    ]
  },
  {
    path: '/find',
    name : '查询',
    component: Index,
    children: [
      {
        path: '/FindAmount',
        name : '查询账目信息',
        component: FindAmount,
      },
      {
        path: '/FindStudent',
        name:'查询使用公司信息',
        component: FindStudent,
      },
      {
        path:'/FindMoney',
        name:'查询催费信息',
        component: FindMoney,
      },
      {
        path:'/FindCourse',
        name:'查询仓库信息',
        component: FindCourse,
      }
    ]
  },
  {
    path: '/update',
    name:'更新',
    component: Index,
    children: [
      {
        path: '/UpdateCourse',
        name:'更新仓库信息',
        component: UpdateCourse,
      }
    ]
  }
]

export const studentLogin = [
  {
    path : '/Find',
    name : '查询',
    component : Student,
    redirect:'/MyCourse',
    children : [
      {
        path : '/MyCourse',
        name : '我的使用',
        component : MyCourse,
      }
    ]
  },
  {
    path: '/choose',
    name: '选择仓库',
    component: Student,
    children: [
      {
        path: '/ShowCourse',
        name:'查询仓库',
        component: ShowCourse,
      },
      {
        path: '/ChooseWarehouse',
        name: '选择仓库',
        component: ChooseWarehouse,
      }
    ]
  },
  {
    path: '/pay',
    name:'自助缴费',
    component: Student,
    children: [
      {
        path: '/Pay',
        name: '仓储费缴费',
        component: Pay,
      }
    ]
  }
]



const router = new VueRouter({
  mode: 'hash',
  routes :startLogin
})

export default router

